﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class EditorUIMenu : Editor
{

    [MenuItem("GameObject/UI/EzButton", priority = 500)]
    static void CreateEzButton()
    {

        GameObject[] objs = Selection.gameObjects;
        if (objs.Length > 0)
        {
            for (int i = 0; i < objs.Length; i++)
            {
                GameObject obj = Resources.Load<GameObject>("EzUI/EzButton");
                GameObject temp = Instantiate(obj, objs[i].transform);
                temp.name = obj.name;
                temp.transform.localPosition = Vector3.zero;
            }
        }
    }

    [MenuItem("GameObject/UI/EzToggleButton", priority = 500)]
    static void CreateEzToggleButton()
    {

        GameObject[] objs = Selection.gameObjects;
        if (objs.Length > 0)
        {
            for (int i = 0; i < objs.Length; i++)
            {
                GameObject obj = Resources.Load<GameObject>("EzUI/EzToggle");
                GameObject temp = Instantiate(obj, objs[i].transform);
                temp.name = obj.name;
                temp.transform.localPosition = Vector3.zero;
            }
        }
    }
}
